/*******************************************************************/
/*                                                                 */
/*  NAME    = send_pcap_thread.h                                                   */
/*  NOTE    =                                                      */
/*  DATE    = 2014/12/11 by yinghl                                    */
/*******************************************************************/

#ifndef __SEND_PCAP_THREAD_H__
#define __SEND_PCAP_THREAD_H__

#include "BaseThread.h"

#include <string>
#include <stdint.h>
#include <libnet.h>

class TestCaseManager;
class CaseConditions;

class SendPcapThread: public BaseThread
{
public:
    SendPcapThread(TestCaseManager &caseMnger, pthread_mutex_t &mutex,
            const CaseConditions &conditions, uint32_t fps, libnet_t *libnet);
    ~SendPcapThread();

    virtual void DoProcess();

    void setChangePortInfo(const std::string &portCmpData, int changePort);

private:
    std::string getNotSendPcap();

private:
    TestCaseManager &caseMnger_;
    pthread_mutex_t &mutex_;
    const CaseConditions &conditions_;
    uint32_t fps_;
    libnet_t *libnetHandle_;
    std::string changePortCmpData_;
    int changePort_;
};
#endif    // #ifndef __SEND_PCAP_THREAD_H__

